#include "StdAfx.h"
#include "ModelessDialog.h"
#include "LightspeedTraderAPIDemo.h"

IMPLEMENT_DYNAMIC(CModelessDialog, CDialog)

CModelessDialog::CModelessDialog(UINT nIDTemplate, CWnd* pParent /*= NULL*/)
	: CDialog(nIDTemplate, pParent)
{
}

CModelessDialog::~CModelessDialog()
{
}

BOOL CModelessDialog::Create(UINT nIDTemplate, CWnd* pParent /*= NULL*/)
{
	return __super::Create(nIDTemplate, pParent);
}

void CModelessDialog::OnOK()
{
	CLightspeedTraderAPIDemoApp::GetInstance()->DestroyDlg(this);
}

void CModelessDialog::OnCancel()
{}

BEGIN_MESSAGE_MAP(CModelessDialog, CDialog)
	ON_WM_CLOSE()
	ON_WM_NCDESTROY()
END_MESSAGE_MAP()

// CModelessDialog message handlers

void CModelessDialog::OnClose()
{
	CLightspeedTraderAPIDemoApp::GetInstance()->DestroyDlg(this);
}

void CModelessDialog::OnNcDestroy()
{
	delete this;
}